//
//  BillSelectTableViewCell.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/8.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "BillSelectTableViewCell.h"
#import <Masonry.h>
@implementation BillSelectTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupViews];
    }
    return self;
}
-(void)setupViews
{

    self.imv = [[UIImageView alloc] init];
    self.imv.image = [UIImage imageNamed:@""];
    [self.contentView addSubview:self.imv];
    
    
    self.lineView = [[UIView alloc] init];
    self.lineView.backgroundColor = ETTableViewLineColor;
    [self.contentView addSubview:self.lineView];
    
    
    self.titleLab = [[UILabel alloc] init];
    self.titleLab.font = [UIFont systemFontOfSize:16];
    self.titleLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    [self.contentView addSubview:self.titleLab];
    
    self.detailLab = [[UILabel alloc] init];
    self.detailLab.numberOfLines = 2;
    self.detailLab.font = [UIFont systemFontOfSize:12];
    self.detailLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    [self.contentView addSubview:self.detailLab];
    
    
    self.timeLab = [[UILabel alloc] init];
    self.timeLab.textColor = [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1];
    self.timeLab.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:self.timeLab];
    
    self.moneyNumLab = [[UILabel alloc] init];
    self.moneyNumLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    self.moneyNumLab.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:self.moneyNumLab];
    
    self.consumeStateLab = [[UILabel alloc] init];
    self.consumeStateLab.textColor = [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1];
    self.consumeStateLab.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:self.consumeStateLab];
    
    
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.imv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(15);
        make.left.mas_equalTo(15);
        make.width.mas_equalTo(40);
        make.height.mas_equalTo(40);
    }];
    
    
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.imv);
        make.left.equalTo(self.imv.mas_right).offset(10);
    }];
    
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLab);
        make.bottom.equalTo(self);
        make.height.mas_equalTo(ETTableViewLineHeight);
        make.right.equalTo(self);
    }];
    
    [self.detailLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleLab.mas_bottom).offset(3);
        make.left.equalTo(self.titleLab);
    }];
    
    [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLab);
        make.bottom.equalTo(self.mas_bottom).offset(-10);
    }];
    
    [self.moneyNumLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.centerY.equalTo(self.titleLab);
    }];
    
    [self.consumeStateLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.top.equalTo(self.moneyNumLab.mas_bottom).offset(3);
    }];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
